-- BP 7.1.6 content: ModelClass syschar: 3 persistence-version: 7.1.6

INSERT INTO O_OBJ
	VALUES ("2a7229e7-e11b-4161-a64d-4cc2748b5e77",
	'Multi-level',
	1003,
	'MLP',
	'A multi-level partitioning represets a supertype partitioning of a proper 
subset. It is the same as a single-level, but of a proper subset.',
	"00000000-0000-0000-0000-000000000000");
INSERT INTO O_TFR
	VALUES ("e1a37f2c-0910-4259-8f6e-c0824240ddfd",
	"2a7229e7-e11b-4161-a64d-4cc2748b5e77",
	'multi-level_init',
	'An example of multi-level subtyping is object A as supertype with subtype 
objects B and C and object C as supertype with subtype objects D and E.





Diagram:
        +---------+ +---------+
        |    D    | |    E    |
        |         | |         |
        +---------+ +---------+
             |           |
             +-----------+
                   |
+---------+   +---------+
|    B    |   |    C    |
|         |   |         |
+---------+   +---------+
     |             |
     +-------------+
            |
       +---------+
       |    A    |
       |         |
       +---------+
',
	"ba5eda7a-def5-0000-0000-000000000000",
	1,
	'// Object A
create object instance domain of DOM;
create object instance modeled_domain of MDOM;
relate domain to modeled_domain across R1;
create object instance objA of OBJ;
relate objA to modeled_domain across R105;
create object instance subA of SUB;
relate subA to objA across R107;
// Subset B
create object instance subB of SUB;
create object instance psubB of PRP;
relate subB to psubB across R107;
create object instance non_psubB of NSB;
relate psubB to non_psubB across R108;
// Subset C - Will be specialized further
create object instance subC of SUB;
create object instance psubC of PRP;
relate subC to psubC across R107;
create object instance non_psubC of NSB;
relate psubC to non_psubC across R108;
// Supertype A
create object instance superA of SUP;
create object instance chdA of CHD;
relate superA to objA across R134 using chdA;
create object instance subtypeB of SBT;
relate superA to psubB across R122 using subtypeB;
create object instance obsB of OBS;
relate obsB to subtypeB across R126;
create object instance sbsB of SBS;
relate sbsB to obsB across R125;
create object instance subtypeC of SBT;
relate superA to psubC across R122 using subtypeC;
// Object specialization of C is done with an attribute below.
// Specialize Subset C
// Subsubset D
create object instance subD of SUB;
create object instance psubD of PRP;
relate subD to psubD across R107;
create object instance non_psubD of NSB;
relate psubD to non_psubD across R108;
// Subsubset E
create object instance subE of SUB;
create object instance psubE of PRP;
relate subE to psubE across R107;
create object instance non_psubE of NSB;
relate psubE to non_psubE across R108;
// Supertype C
create object instance superC of SUP;
create object instance multiC of MLV;
relate superC to psubC across R114 using multiC;
create object instance subtypeD of SBT;
relate superC to psubC across R122 using subtypeD;
create object instance obsD of OBS;
relate obsD to subtypeD across R126;
create object instance sbsD of SBS;
relate sbsD to obsD across R125;
create object instance subtypeE of SBT;
relate superC to psubE across R122 using subtypeE;
create object instance obsE of OBS;
relate obsE to subtypeE across R126;
create object instance sbsE of SBS;
relate sbsE to obsE across R125;
// Attributes
// Make the first one an identifier, as you can''t create instances without an 
// identifier.
create object instance attribute1 of ATR;
create object instance nonref1 of NRA;
relate attribute1 to nonref1 across R103;
create object instance objectAttribute1 of OA;
relate objectAttribute1 to attribute1 across R124;
relate objectAttribute1 to objA across R129;
create object instance identifier1 of ID;
create object instance participation1 of IDP;
relate identifier1 to attribute1 across R102 using participation1;
// Make the second one a specializer for one of the subtypes.
create object instance attribute2 of ATR;
create object instance nonref2 of NRA;
relate attribute2 to nonref2 across R103;
create object instance attribution2 of SPA;
relate attribution2 to attribute2 across R124;
relate attribution2 to psubC across R130;
create object instance objectSpecialization2 of OBS;
relate attribution2 to objectSpecialization2 across R125;
relate objectSpecialization2 to subtypeC across R126;
// Create an attribute on the supertype
create object instance attribute3 of ATR;
create object instance nonref3 of NRA;
relate attribute3 to nonref3 across R103;
create object instance objectAttribute3 of OA;
relate objectAttribute3 to attribute3 across R124;
relate objectAttribute3 to objA across R129;
// Create instances of OBJ A
// Note: Attempts to create instances of superA or super/subtypeC should be 
//       illegal. TODO: Add checks for this.
// Create an instance of subtype B
create object instance instance1 of INS;
relate instance1 to subB across R112;
create object instance instantiation1 of ITN;
relate instance1 to identifier1 across R101 using instantiation1;
// Create an instance of subtype D
create object instance instance3 of INS;
relate instance3 to subD across R112;
create object instance instantiation3 of ITN;
relate instance3 to identifier1 across R101 using instantiation3;
// Create an instance of subtype E
create object instance instance4 of INS;
relate instance4 to subE across R112;
create object instance instantiation4 of ITN;
relate instance4 to identifier1 across R101 using instantiation4;',
	1,
	'',
	"00000000-0000-0000-0000-000000000000",
	0);
INSERT INTO O_ID
	VALUES (0,
	"2a7229e7-e11b-4161-a64d-4cc2748b5e77");
INSERT INTO O_ID
	VALUES (1,
	"2a7229e7-e11b-4161-a64d-4cc2748b5e77");
INSERT INTO O_ID
	VALUES (2,
	"2a7229e7-e11b-4161-a64d-4cc2748b5e77");
INSERT INTO PE_PE
	VALUES ("2a7229e7-e11b-4161-a64d-4cc2748b5e77",
	1,
	"6e3add14-c14c-40a1-95a3-bbc196442c2d",
	"00000000-0000-0000-0000-000000000000",
	4);
INSERT INTO EP_PKG_PROXY
	VALUES ("6e3add14-c14c-40a1-95a3-bbc196442c2d",
	"00000000-0000-0000-0000-000000000000",
	"c8b88000-dddc-4206-8410-2f69b8f86b67",
	'Object Subsystem Tests',
	'This package can be used to check various instantiation scenarios for the 
object subsystem.
Current usage: Create an unspecialized object, and create each of the types of 
specialized objects.',
	1000,
	'../Object Subsystem Tests.xtuml');
